package day1.HomeWork;

/**
 * ClassName：TestStudent
 *
 * @Author：小鱼
 * @Create：2025-08-18 17:32
 */
public class TestStudent {
    public static void main(String[] args) {
        try {
            Student student1 = new Student("张三", 20);
            System.out.println("学生1创建成功：" + student1.getName() + "，年龄：" + student1.getAge());
        } catch (AgeOutRangeException e) {
            System.out.println("学生1创建失败：" + e.getMessage());
        }
        try {
            Student student1 = new Student("张三", 5);
            System.out.println("学生2创建成功：" + student1.getName() + "，年龄：" + student1.getAge());
        } catch (AgeOutRangeException e) {
            System.out.println("学生2创建失败：" + e.getMessage());
        }
    }
}
